package com.smart.community.commons.constant;

/**
 * 通用常量类
 * 定义系统中通用的常量值
 * 
 * @author Wu.Liang
 * @version 1.0.0
 * @since 2024-12-19
 */
public class CommonConstant {
    
    // 工具类，防止实例化
    private CommonConstant() {
    }
    
    // ========================= 通用状态常量 =========================
    /**
     * 成功标记
     */
    public static final Integer SUCCESS = 200;
    
    /**
     * 失败标记
     */
    public static final Integer FAIL = 500;
    
    /**
     * 是
     */
    public static final Integer YES = 1;
    
    /**
     * 否
     */
    public static final Integer NO = 0;
    
    // ========================= 删除标记常量 =========================
    /**
     * 删除标记 - 已删除
     */
    public static final Integer DELETED = 1;
    
    /**
     * 删除标记 - 未删除
     */
    public static final Integer NOT_DELETED = 0;
    
    // ========================= 默认值常量 =========================
    /**
     * 默认页码
     */
    public static final int DEFAULT_PAGE_NUM = 1;
    
    /**
     * 默认每页条数
     */
    public static final int DEFAULT_PAGE_SIZE = 20;
    
    /**
     * 最大每页条数
     */
    public static final int MAX_PAGE_SIZE = 500;
    
    /**
     * 默认密码
     */
    public static final String DEFAULT_PASSWORD = "123456";
    
    // ========================= 缓存过期时间常量 =========================
    /**
     * 缓存过期时间 - 5分钟
     */
    public static final long CACHE_EXPIRE_5_MIN = 5 * 60;
    
    /**
     * 缓存过期时间 - 10分钟
     */
    public static final long CACHE_EXPIRE_10_MIN = 10 * 60;
    
    /**
     * 缓存过期时间 - 30分钟
     */
    public static final long CACHE_EXPIRE_30_MIN = 30 * 60;
    
    /**
     * 缓存过期时间 - 1小时
     */
    public static final long CACHE_EXPIRE_1_HOUR = 60 * 60;
    
    /**
     * 缓存过期时间 - 1天
     */
    public static final long CACHE_EXPIRE_1_DAY = 24 * 60 * 60;
    
    // ========================= 缓存前缀常量 =========================
    /**
     * 登录用户Redis key前缀
     */
    public static final String LOGIN_USER_PREFIX = "login_user:";
    
    /**
     * 验证码Redis key前缀
     */
    public static final String CAPTCHA_PREFIX = "captcha:";
    
    /**
     * 短信验证码Redis key前缀
     */
    public static final String SMS_CODE_PREFIX = "sms_code:";
    
    /**
     * 邮箱验证码Redis key前缀
     */
    public static final String EMAIL_CODE_PREFIX = "email_code:";
    
    // ========================= 认证相关常量 =========================
    /**
     * Token前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";
    
    /**
     * Token在Header中的key
     */
    public static final String AUTHORIZATION = "Authorization";
    
    /**
     * 用户ID在Header中的key
     */
    public static final String USER_ID_HEADER = "X-User-Id";
    
    /**
     * 用户名在Header中的key
     */
    public static final String USERNAME_HEADER = "X-Username";
    
    /**
     * 租户ID在Header中的key
     */
    public static final String TENANT_ID_HEADER = "X-Tenant-Id";
    
    /**
     * 请求来源
     */
    public static final String REQUEST_SOURCE = "X-Request-Source";
    
    /**
     * 内部调用标识
     */
    public static final String INTERNAL_REQUEST = "internal";
    
    /**
     * 外部调用标识
     */
    public static final String EXTERNAL_REQUEST = "external";
    
    // ========================= 用户类型常量 =========================
    /**
     * 用户类型 - 管理员
     */
    public static final String USER_TYPE_ADMIN = "ADMIN";
    
    /**
     * 用户类型 - 普通用户
     */
    public static final String USER_TYPE_USER = "USER";
    
    // ========================= 状态常量 =========================
    /**
     * 启用状态
     */
    public static final String STATUS_ENABLE = "1";
    
    /**
     * 禁用状态
     */
    public static final String STATUS_DISABLE = "0";
    
    // ========================= 编码常量 =========================
    /**
     * UTF-8编码
     */
    public static final String UTF8 = "UTF-8";
}
